package com.king.modules.monitor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.king.framework.base.service.impl.YyBaseServiceImpl;
import com.king.modules.monitor.domain.SysOperLogEntity;
import com.king.modules.monitor.mapper.SysOperLogMapper;
import com.king.modules.monitor.service.SysOperLogService;

/**
 * 操作日志 服务层处理
 * 
 * @author king
 */
@Service
public class SysOperLogServiceImpl extends YyBaseServiceImpl<SysOperLogMapper, SysOperLogEntity, Long> implements SysOperLogService {
	@Autowired
	private SysOperLogMapper operLogMapper;

	/**
	 * 新增操作日志
	 * 
	 * @param operLog
	 *            操作日志对象
	 */

	@Transactional(readOnly = false, rollbackFor = {Exception.class})
	@Override
	public void insertOperlog(SysOperLogEntity operLog) {
		operLogMapper.insertOperlog(operLog);
	}

	/**
	 * 查询系统操作日志集合
	 * 
	 * @param operLog
	 *            操作日志对象
	 * @return 操作日志集合
	 */
	@Override
	public List<SysOperLogEntity> selectOperLogList(SysOperLogEntity operLog) {
		return operLogMapper.selectOperLogList(operLog);
	}

	/**
	 * 批量删除系统操作日志
	 * 
	 * @param operIds
	 *            需要删除的操作日志ID
	 * @return 结果
	 */
	@Transactional(readOnly = false, rollbackFor = {Exception.class})
	@Override
	public int deleteOperLogByIds(Long[] operIds) {
		return operLogMapper.deleteOperLogByIds(operIds);
	}

	/**
	 * 清空操作日志
	 */
	@Transactional(readOnly = false, rollbackFor = {Exception.class})
	@Override
	public void cleanOperLog() {
		operLogMapper.cleanOperLog();
	}
}
